package com.kwedding.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.kwedding.dto.app.RequestGetImage;
import com.kwedding.dto.app.ResponseImages;
import com.kwedding.service.app.ImageService;
import com.kwedding.util.BackJson;
import com.kwedding.util.JsonBackBase;
import com.kwedding.util.LoggerParent;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Controller
@RequestMapping("/rest/image")
@Api(tags = "图片")
public class ImageController extends LoggerParent {

	@Autowired
	private ImageService imageService;

	@ApiOperation("根据品牌和类型获取图片内容")
	@ResponseBody
	@RequestMapping(value = "getImages", method = { RequestMethod.POST })
	public JsonBackBase<List<ResponseImages>> getImages(@RequestBody RequestGetImage getImage) {
		return BackJson.successObj(imageService.getImages(getImage));

	}
}
